package cn.virens.common.exception;

/**
 * 重连异常
 * 
 * @作者   : virens
 * @创建时间 :2018年7月24日 下午5:14:57
 */
public class TimeoutException extends RuntimeException {
	private static final long serialVersionUID = 2140385958298769753L;

	private Integer heartidleCount;
	private Integer heartbeatCount;

	public TimeoutException() {
		super();
	}

	public int getHeartidleCount() {
		return heartidleCount;
	}

	public void setHeartidleCount(Integer heartidleCount) {
		this.heartidleCount = heartidleCount;
	}

	public Integer getHeartbeatCount() {
		return heartbeatCount;
	}

	public void setHeartbeatCount(Integer heartbeatCount) {
		this.heartbeatCount = heartbeatCount;
	}

	public static TimeoutException of(Integer heartidleCount, Integer heartbeatCount) {
		TimeoutException answer = new TimeoutException();
		answer.setHeartbeatCount(heartbeatCount);
		answer.setHeartidleCount(heartidleCount);

		return answer;
	}
}
